﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
using System.Web.Script.Serialization;
namespace AlltrustDinner
{
    public class HttpHandlerProcess : IRequiresSessionState
    {
        protected string url;
        protected string cmd;
        protected JavaScriptSerializer Serializer = new JavaScriptSerializer();
        protected Dictionary<string, Dictionary<string, string>> queryParam = new Dictionary<string, Dictionary<string, string>>();
        protected void GetQueryParam(HttpContext context)
        {
            queryParam = Serializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(context.Request.Form[0]);
            if (queryParam.Keys.Contains("AjaxRequest"))
            {
                url = queryParam["AjaxRequest"]["URL"];
                cmd = queryParam["AjaxRequest"]["Command"];
            }
        }
    }
}